package org.blade.personal.utils.pdm;

import java.io.InputStream;
import java.io.Reader;
import java.util.List;

import org.dom4j.Document;
import org.dom4j.Element;

/**
 * pdm 解释器
 * @author ZGF
 *
 */
public interface PdmParser {

	public Pdm parseXml2Pdm(String pdmXml);
	
	public Pdm parseXml2Pdm(Reader reader);
	
	public Pdm parseXml2Pdm(InputStream in);
	
	public Pdm getFromDocuemnt(Document doc);
	
	/**
	 * 获取表
	 * @param doc pdm文档
	 * @return
	 */
	public List<PdmTable> getTables(Document doc);
	
	
	public PdmColumn getColumn(Element columnElement);
	
	/**
	 * 获取列
	 * @param tableElement pdm 表文档
	 * @return
	 */
	public List<PdmColumn> getColumns(Element tableElement);
	
	/**
	 * 获取键
	 * @param tableElement pdm 表文档
	 * @return
	 */
	public List<PdmKey> getKeys(Element tableElement);
	
}
